// 编辑
export const useEditTable = (
  row: any,
  onEdit: (...any) => any,
  callback?: any
) => {
  const editTableApi = (editedParams, fullParams) => {
    return new Promise((resolve, reject) => {
      let parmas = { ...row.value, ...editedParams };
      if (callback) {
        parmas = callback(parmas);
      }
      onEdit(parmas)
        .then(() => {
          resolve(true);
        })
        .catch((err) => {
          reject(err);
        });
    });
  };
  return {
    editTableApi,
  };
};
